#include <iostream>//Rectangle.cpp
#include <math.h>
#include "Rectangle.h"

using namespace std;

Rectangle::Rectangle(double x1,double y1,double x2,double y2)
:left_top_x(x1),left_top_y(y1),right_bot_x(x2),right_bot_y(y2){}

double Rectangle::Diagonal()
{
    return sqrt(pow(left_top_x-right_bot_x,2)+pow(left_top_y-right_bot_y,2));
}

void Rectangle::Show()
{
    cout<<"The point of left top: "<<'('<<left_top_x<<','<<left_top_y<<')'<<endl;
    cout<<"The point of right bottom: "<<'('<<right_bot_x<<','<<right_bot_y<<')'<<endl;
    cout<<"The diagonal: "<<Diagonal()<<endl;
}
